﻿using System.Web;
using ErrorDumper.Processing;
using ErrorDumper.PropertyExtracting;

namespace ErrorDumper.Web.Processors {
    public class HttpContextProcessor : IExceptionProcessor {

        public void ProcessException(ExceptionProcessorContext processorContext) {
            var current = HttpContext.Current;
            if (current == null)
                return;

            ExceptionPropertyExtractors.ExtractProperties(
                new HttpContextWrapper(current), processorContext.Properties);
        }
    }
}